import http from '@/utils/http'


/**
 * 获取登录用户的地址列表
 */
//  /member/address
export const getMembeAddress = () => {
    return http({
        url: '/member/address'
    })
}


/**
 * 新增地址
 * @param {Object} data 新增的地址对象
 */

export const addMembeAddress = (data) => {
    return http({
        url: '/member/address',
        method: 'post',
        data
    })
}


/**
 * 
 *  根据地址id来实现 删除地址
 * @param {string} id 地址id
 */

export const deleteMembeAddress = (id) => {
    return http({
        url: `/member/address/${id}`,
        method: 'delete',
    })
}


/**
 * 根据id查询信息
 * @param {string} id  
 * 
 */
export const getDetailMembeAddress = (id) => {
    return http({
        url: `/member/address/${id}`,
        method: 'get',
    })
}


/**
 * 根据id修改地址
 * @param {string} id  id 待修改地址的id
 * @param {object} data  data 地址信息
 * 
 */

export const putMembeAddress = (id,data) => {
    return http({
        url: `/member/address/${id}`,
        method: 'put',
        data
    })
}